<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <table>
        <thead>
            <tr>
                <th>用户编号</th>
                <th>用户姓名</th>
                <th>用户密码</th>
            </tr>
        </thead>
        <tbody>

        </tbody>
    </table>

    <script>
         function showUser(){
            let tb=document.querySelector("tbody");
            let xhr=new XMLHttpRequest();
            xhr.open("get",`/showUserList`);
            xhr.onload=function(){
                let res=JSON.parse(xhr.responseText);
                let str="";
                res.forEach(function(item,index){
                    str+=`<tr>
                            <td>${item.id}</td>
                            <td>${item.username}</td>
                            <td>${item.password}</td>

                         </tr>`;
                });
                tb.innerHTML=str;

            };
            xhr.send();
        }
        showUser();
    </script>
</body>
</html>